<?php
/**
 * Created by PhpStorm.
 * User: qinshuguo
 * Date: 16/6/17
 * Time: 14:28
 */

namespace App\Api\Auth\Requests;

use App\Http\Requests\Request;

class PermissionRequest extends Request
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name'=>'required',
            'id'=>'sometimes|exists:permissions',
            'display_name'=>'string',
            'description'=>'string',
            'level'=>'required',
            'parent_id'=>'sometimes|exists:permissions,id',
        ];
    }
}
